home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / Technical Documentation / develop / develop Issue 24 / develop Issue 24 code / Scriptable Database 1.0a15 / Blue / EventHandlerTable.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-19  |  1.3 KB  |  47 lines  |  [TEXT/CWIE]

  1.  
  2. #pragma once
  3.  
  4. #ifndef __EVENTHANDLERTABLE__
  5. #define __EVENTHANDLERTABLE__
  6.  
  7. #include <AppleEvents.h>
  8.  
  9. //
  10. // We define our own EventHandlerProcPtr because we cannot predict
  11. // what AEEventHandlerUPP might be (a UniversalProcPtr or an
  12. // AEEventHandlerProcPtr), nor can we guarentee that AEEventHandlerProcPtr
  13. // will always be defined.
  14. //
  15. typedef pascal OSErr (*EventHandlerProcPtr)(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon);
  16.  
  17. //
  18. // More stuff that's missing from the old headers...
  19. //
  20. typedef struct OpaqueAEDispatcher *AEDispatcher;
  21. typedef UInt32 AEReceiveMode;
  22. enum {
  23.     kAEReceiveForever            = 0x00000000,
  24.     kAEReceiveOneEvent            = 0x00000001,
  25.     kAEReceiveUntilUnhandledEvent = 0x00000002
  26. };
  27.  
  28. //========================================================================================
  29. // CLASS TEventHandlerTable
  30. //========================================================================================
  31.  
  32. class TEventHandlerTable
  33.     {
  34. protected:
  35.  
  36.  
  37. public:
  38.     TEventHandlerTable();
  39.     ~TEventHandlerTable();
  40.     
  41.     OSStatus            InstallHandler(AEEventClass handlerClass, AEEventID handlerID, EventHandlerProcPtr handler, UInt32 handlerRefcon);
  42.     OSStatus            Receive(AEReceiveMode receiveMode = kAEReceiveOneEvent, long maxSleepTime = 60*60 /* about one minute */);
  43.  
  44.     };
  45.  
  46. #endif
  47.